package com.casstime.ec.cloud.values.giftPromotion.enums;

/**
 * 
 * ClassName: PolicyTypeEnum 
 * Function: (售后配置类型)
 * Reason: ADD REASON(可选).
 *  
 * @author wu.chen 
 * 2018年1月30日 下午2:01:31
 * @version   
 * @since JDK 1.8
 */
public enum GiftConfigValueEnum {
	
	PLATFORM_ALL("PC电脑端/APP手机端", "PLATFORM_ALL"), 
	PLATFORM_PC("PC电脑端", "PLATFORM_PC"), 
	PLATFORM_APP("APP手机端", "PLATFORM_APP"), 
	
	GIFT_ALL("全部", "GIFT_ALL"),
	GIFT_IMD("买就赠", "GIFT_IMD"),
	GIFT_REQUIRE("买满赠", "GIFT_REQUIRE"),
	
	CUSTOMER_ALL("全部客户", "CUSTOMER_ALL"),
	CUSTOMER_NEW("未交易客户", "CUSTOMER_NEW"),
	CUSTOMER_OLD("已交易客户", "CUSTOMER_OLD"),
	
	AREA_LIMIT("区域限制", "AREA_LIMIT"),
	AREA_LIMIT_DEFAULT("可报价全部城市", "AREA_LIMIT_DEFAULT"),
	AREA_LIMIT_CUSTOM("自定义（可报价区域部分城市）", "AREA_LIMIT_CUSTOM"),
	
	STATUS_ALL("全部", "STATUS_ALL"),
	STATUS_READY("未开始", "STATUS_READY"),
	STATUS_START("进行中", "STATUS_START"),
	STATUS_END("已结束", "STATUS_END");
	
	// 成员变量
    private String name;
    private String index;

    // 构造方法
    GiftConfigValueEnum(String name, String index) {
        this.name = name;
        this.index = index;
    }

    // 普通方法
    public static String getName(String index) {
        for (GiftConfigValueEnum c : GiftConfigValueEnum.values()) {
            if (c.getIndex().equals(index)) {
                return c.name;
            }
        }
        return null;
    }

    // get set 方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    // 覆盖方法
    @Override
    public String toString() {
        return this.index + "_" + this.name;
    }
}
